class Solution:
    def reverseStr(self, s: str, k: int) -> str:
        res=""
        n=len(s)
        for i in range(0,n,2*k):
            temp=s[i:i+k]
            res+=temp[::-1]
            res+=s[i+k:i+2*k]
        # print(i)
        # print(res,"0")
        # if n - i >=k:
        #     temp = s[i:i+k]
        #     res+=temp[::-1]
        #     res+=s[i+k:n]
        #     print(res,"1")
        # elif n -i < k:
        #     temp =s[i:n]
        #     res+=temp[::-1]
        #     print(res,"2")
        return res

ss= Solution()
s="abcdefg"
k=2
print(ss.reverseStr(s, k))